package cn.gxa.j229.bug.finance.service.loanuser.impl;

/*
 *
 *@author leijun
 *
 *@creating 2020/9/29 11:51
 *
 */

import cn.gxa.j229.bug.finance.BusinessException;
import cn.gxa.j229.bug.finance.controller.ExceptionController;
import cn.gxa.j229.bug.finance.mapper.Auth_CrudMapper;
import cn.gxa.j229.bug.finance.pojo.Auth_Crud;
import cn.gxa.j229.bug.finance.service.loanuser.Auth_CrudService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.LinkedList;
import java.util.List;

/**
 * @ClassName Auth_CrudServiceImpl
 * @Description TODO
 * @Author 俊
 * @Date 2020/9/29 11:51
 * @Version 1.0
 */
@Service("auth_CrudService")
public class Auth_CrudServiceImpl implements Auth_CrudService {

    @Resource
    Auth_CrudMapper auth_crudMapper;

    public  List<String> getType(String username){
        List<String > a=new LinkedList<>();
        try {
            if (username.trim().equals("")){
                return null;
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        List<Auth_Crud> auth_cruds = auth_crudMapper.findByUsername(username);

        for (int i=0;i<auth_cruds.size();i++) {
            String type = auth_cruds.get(i).getType();
            a.add(type);
        }

        return a;
    }
}
